package org.jtb.quickr;

import java.util.HashMap;
import java.util.Map;

final class AuthUrl extends SignedUrl {
    private FrobResponse frob;
    private Permissions perms;
    
    public AuthUrl(String authUrl, String apiKey, String secret, FrobResponse frob, Permissions perms) throws QuickrException {
        super(authUrl, apiKey, secret);
        this.frob = frob;
        this.perms = perms;
    }        

    public AuthUrl(String authUrl, String apiKey, String secret, Permissions perms) throws QuickrException {
        super(authUrl, apiKey, secret);
        this.perms = perms;
    }        
    
    protected Map<String,String> getArgs() {
        putArg("perms", perms.toString());
        if (frob != null) {
            putArg("frob", frob.toString());     
        }
        
        return super.getArgs();
    }        
}
